import {
	http,
	Method
} from "@/utils/request.js"

/**
 * 获取首页分类
 */
export function GetClassify (params) {
	return http.request({
		url: "/category/index",
		method: Method.GET,
		params
	})
}
/**
 * 获取滚动消息
 */
export function GetRollNews (params) {
	return http.request({
		url: "/message/list",
		method: Method.GET,
		params
	})
}
/**
 * 获取本地好店
 */
export function GetGoodStore (params) {
	return http.request({
		url: "/pageData/getGoodShop",
		method: Method.GET,
		params
	})
}
/**
 * 获取热销商品
 */
export function GetHotGoods (params) {
	return http.request({
		url: "/pageData/hotGoods",
		method: Method.GET,
		params
	})
}
/**
 * 获取新店新品
 */
export function GetNewProduct (params) {
	return http.request({
		url: "/pageData/new",
		method: Method.GET,
		params
	})
}
/**
 * 获取活动专区
 */
export function GetActivity (params) {
	return http.request({
		url: "/activity/list",
		method: Method.GET,
		params
	})
}
/**
 * 宣传活动详情
 */
export function publicityInfo (id,params) {
	return http.request({
		url: `/activity/${id}`,
		method: Method.GET,
		params
	})
}
/**
 * 商品活动参与的商品
 */
export function goodsInfoList (params) {
	return http.request({
		url: `/activity/act/${params.id}`,
		method: Method.GET,
		params
	})
}
/**
 * 获取经纬度
 */
export function GetTrapeze (params) {
	return http.request({
		url: "/setting/get",
		method: Method.GET,
		params
	})
}
/**
 * 获取本地商圈
 */
export function GetGoodShopPage (params) {
	return http.request({
		url: "/pageData/getGoodShopPage",
		method: Method.GET,
		params
	})
}
/**
 * 获取实物商品
 */
export function GetGoodPage (params) {
	return http.request({
		url: "/pageData/getGoodPage",
		method: Method.GET,
		params
	})
}
/**
 * 爆品商品
 */
export function GetCommodity (params) {
	return http.request({
		url: "/pageData/getCommodity",
		method: Method.GET,
		params
	})
}
/**
 * 推荐好店
 */
export function GetCommodityShop (params) {
	return http.request({
		url: "/pageData/getCommodityShop",
		method: Method.GET,
		params
	})
}
/**
 * 实物商品
 */
export function GetRegionCo (params) {
	return http.request({
		url: "/pageData/getRegionCo",
		method: Method.GET,
		params
	})
}

/**
 * 获取广告图
 */
export function getAdvertisement () {
	return http.request({
		url: "/advertisement",
		method: Method.GET,
	})
}



/**
 * 获取首页商品分类
 * @param parent_id
 */
export function getCategory (parent_id = 0) {
	return http.request({
		url: `goods/categories/${parent_id}/children`,
		method: Method.GET,
		loading: false,
	})
}
// /buyer/orders/news 滚动消息
export function scrollNews () {
	return http.request({
		url: `/orders/news`,
		method: Method.GET,
		loading: false,
	})
}
/**
 * 获取热门关键词
 * @param num
 */
export function getHotKeywords (count) {
	return http.request({
		url: "/goods/hot-words",
		method: Method.GET,
		loading: false,
		params: {
			count
		},
	})
}

/**
 * 获取楼层数据
 * @param client_type
 * @param page_type
 */
export function getFloorData () {
	return http.request({
		url: `/pageData/getIndex?clientType=H5`,
		method: "get",
	})
}

/**
 * 获取获取首页分类数据
 */
export function getCategoryIndexData (parentId = 0) {
	return http.request({
		url: `/category/get/${parentId}`,
		method: "get",
	})
}
// 动态获取首页板块展示内容
export function homepage () {
	return http.request({
		url: `/homepage`,
		method: "get",
	})
}